<?php
/* @var $this DashboardController */
//$serviceRequest=$_data_['serviceRequest'];
$service = $serviceRequest->service;
$event = $serviceRequest->event;
?>
<div>
    <h3 style="color:#666;font:normal 18px arial">Mark  As Done</h3>

    <table>
        <tr><td style="color:#666;font:normal 14px arial;width:300px;"> Service Name :</td><td style="color:#666;font:normal 14px arial"> <?php echo $service->name ?></td></tr>
        <tr><td style="color:#666;font:normal 14px arial;width:300px;"> Customer Name :</td><td style="color:#666;font:normal 14px arial">  <?php echo $serviceRequest->user->profile->name ?></td></tr>
    </table>

    <style>
        input[type='submit']{
            background: linear-gradient(to bottom, #d0451b 5%, #bc3315 100%) repeat scroll 0 0 #d0451b;
            border: 1px solid #942911;
            border-radius: 3px;
            box-shadow: 0 1px 0 0 #cf866c inset;
            color: #ffffff;
            cursor: pointer;
            display: inline-block;
            font-family: arial;
            font-size: 13px;float: right;
            padding: 6px 24px;
            text-decoration: none;
            text-shadow: 0 1px 0 #854629;
        }
    </style>
    <form method="POST"  action="<?php echo CController::createUrl('Service/DoneRequest') ?>">

        <input type="hidden" name="requestId" value="<?php echo $serviceRequest->id ?>"/>
        <input type="hidden" name="finish" value="true"/>
        <?php
        $tools = $service->serviceTools;
        echo '<table><tr>';
        if (isset($tools)) {
            foreach ($tools as $key => $value) {

                $_id = "item" . $value->item->id;
                echo '<tr><td style="color:#666;font:normal 14px arial;width:300px;">';
                echo CHtml::label($value->item->name, $_id);
                echo '</td><td style="color:#666;font:normal 14px arial;width:300px;">';
                echo CHtml::textField($_id, 'value=' + $value->no_item);
                echo '</td></tr>';
            }
        }
        echo '</tr></table>';
        ?>
        <input type="submit" value="Mark Done" style="margin-top:20px;visibility: <?php echo $serviceRequest->status == ServiceRequest::STATUS_DONE ? 'hidden' : 'visible'; ?>"/>
    </form>
</div>